package cn.edu360t.Tags
import org.apache.commons.lang3.StringUtils
import org.apache.spark.sql.Row
object Tags4Area extends Tags{
  override def makeTags(args: Any*): Map[String, Int] = {
    var map = Map[String, Int]()

    val row = args(0).asInstanceOf[Row]

    // 地域标签
    val pName = row.getAs[String]("provincename")
    val cName = row.getAs[String]("cityname")

    if (StringUtils.isNotEmpty(pName)) map += "ZP"+pName -> 1
    if (StringUtils.isNotEmpty(cName)) map += "ZC"+cName -> 1

    map
  }
}
